<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增用户特权')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-userprivilege-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">K号：</label>
                <div class="col-sm-8">
                    <input name="kkno" class="form-control" type="text" th:value="${kkno}" readonly >
                    <input name="kkid" class="form-control" type="hidden" th:value="${kkid}" >
                    <input name="appId" class="form-control" type="hidden" th:value="${appId}" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">特权类型： </label>
                <div class="col-sm-8">
                    <select name="type" class="form-control m-b" th:with="type=${@dict.getType('member_privilege_type')}" style="pointer-events: none;">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${privilegeType} == ${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">发放时间：</label>
                <div class="col-sm-8">
                    <select name="period" class="form-control m-b">
                        <option value="1">一个月</option>
                        <option value="6">半年</option>
                        <option value="12">一年</option>
                        <option value="240">终身</option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "user/userprivilege"
        $("#form-userprivilege-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-userprivilege-add').serialize());
            }
        }

    </script>
</body>
</html>